package com.yc.bean2;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author zwei
 * @create 2024-07-28 16:32
 */
public class App1_ComponentScan {
    public static void main(String[] args) {
        //创建容器
        ApplicationContext ac=new AnnotationConfigApplicationContext(AppConfig.class);
        Apple a=(Apple) ac.getBean("apple");
        System.out.println(a);
        ProductDao pd=(ProductDao) ac.getBean("productDao");
        System.out.println(pd);
    }
}
